Skip to content

Comments

feat: add Windows support for socket communication#44

Closed
tucaman wants to merge 1 commit intonicobailon:mainfrom
jeannAI:windows-support
Closed

feat: add Windows support for socket communication#44
tucaman wants to merge 1 commit intonicobailon:mainfrom
jeannAI:windows-support

Conversation

@tucaman
Copy link

@tucaman tucaman commented Feb 21, 2026

Summary

  • Replace hardcoded /tmp/surf.sock Unix socket paths with platform-conditional logic
  • Use Windows named pipes (\.\pipe\surf-sock) on win32, os.tmpdir() on Unix
  • Fix LOG_FILE in host.cjs to use os.tmpdir() on Windows
  • Add missing os and path imports to do-executor.cjs and mcp-server.cjs

Fixes #43
Related to #42 (same user-facing error, different root cause — Windows path vs macOS socket creation)

Changes

4 files in native/:

File Change
cli.cjs SOCKET_PATH → platform conditional
do-executor.cjs SOCKET_PATH → platform conditional + added os/path imports
host.cjs SOCKET_PATH + LOG_FILE → platform conditional
mcp-server.cjs SOCKET_PATH → platform conditional + added os/path imports

Test plan

  • Tested on Windows 11 Pro with Node.js v22 — surf tab.list connects and returns Chrome tabs
  • Backward-compatible: Unix paths unchanged (uses os.tmpdir() which returns /tmp on Linux/macOS)

Replace hardcoded /tmp/surf.sock Unix socket paths with
platform-conditional logic that uses Windows named pipes
(\.\pipe\surf-sock) on win32 and os.tmpdir() on Unix.

Also fixes the LOG_FILE path in host.cjs to use os.tmpdir()
on Windows instead of the non-existent /tmp/ directory.

Files changed:
- native/cli.cjs: SOCKET_PATH
- native/do-executor.cjs: SOCKET_PATH + added os/path imports
- native/host.cjs: SOCKET_PATH + LOG_FILE
- native/mcp-server.cjs: SOCKET_PATH + added os/path imports
@nicobailon
Copy link
Owner

Closing in favor of #39 which covers the same ground plus ImageMagick quoting, unlinkSync/chmodSync skip, temp file routing, and network-store paths. Thanks for the contribution!

@nicobailon nicobailon closed this Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows support: hardcoded /tmp/ paths break on Windows

2 participants